package top.minuy.structure.graph.bridge;

import top.minuy.res.graph.GraphRes;
import top.minuy.structure.graph.representations.table.Graph;

/**
 * @author Minuy
 * @time 20:55
 * @date 2021/11/21
 */
public class Test {
    public static void main(String[] args) {
        Graph g1 = new Graph(GraphRes.G_BRIDGE_1);
        FindBridges fb1 = new FindBridges(g1);
        FindCutVertex fcv1 = new FindCutVertex(g1);
        System.out.println("桥："+fb1.bridges());
        System.out.println("割点："+fcv1.cutVertex());


        Graph g2 = new Graph(GraphRes.G_BRIDGE_2);
        FindBridges fb2 = new FindBridges(g2);
        FindCutVertex fcv2 = new FindCutVertex(g2);
        System.out.println("桥："+fb2.bridges());
        System.out.println("割点："+fcv2.cutVertex());

        Graph g3 = new Graph(GraphRes.G_BRIDGE_3);
        FindBridges fb3 = new FindBridges(g3);
        FindCutVertex fcv3 = new FindCutVertex(g3);
        System.out.println("桥："+fb3.bridges());
        System.out.println("割点："+fcv3.cutVertex());

        Graph g4 = new Graph(GraphRes.G_BRIDGE_4);
        FindBridges fb4 = new FindBridges(g4);
        FindCutVertex fcv4 = new FindCutVertex(g4);
        System.out.println("桥："+fb4.bridges());
        System.out.println("割点："+fcv4.cutVertex());
    }

    /* [3 - 5]
     * [6 - 8, 4 - 7, 3 - 5]
     * []
     * [1 - 6, 0 - 1, 2 - 5, 3 - 2, 3 - 4, 0 - 3]
     */

    /* [3 - 5]
     * [11 - 9, 6 - 8, 4 - 7, 3 - 5]
     * [2 - 3, 1 - 3]
     * [1 - 6, 0 - 1, 2 - 5, 3 - 2, 3 - 4, 0 - 3]
     */
}
